import mysql.connector

if __name__ == '__main__':
    # mydb = mysql.connector.connect(
    #     host="172.20.100.11",
    #     port=3306,
    #     user="yunxiangdev",
    #     password="yunxiang123!",
    #     database="yunxiangloan"
    # )
    # mydb.autocommit = True
    # mycursor = mydb.cursor()
    # execute = mycursor.execute("SELECT * FROM car_area_model")
    # map = {}
    # for x in mycursor:
    #     # map[x[2]] = x
    #     for i in x:
    #         if str(i).find(' ') != -1:
    #             print(i)

    # keys = map.keys()

    mydb2 = mysql.connector.connect(
        host="172.20.100.12",
        port=3306,
        user="yunxiangdev",
        password="yunxiangDev!",
        database="customer-system"
    )
    # mycursor2 = mydb2.cursor()
    # execute = mycursor2.execute("SELECT * FROM vehicle_plate_city")
    # result = mycursor2.fetchall()
    # for x in result:
    #     print(x)
        # for i in x:
        #     print(i)
        #     if str(i).find(' ') != -1:
        #         print(i)

    # execute = mycursor2.execute("SELECT * FROM vehicle_plate_city")
    # map2 = {}
    # for x in mycursor2:
    #     if map2.get(x[1]) is None:
    #         map2[x[1]] = x
    #     else:
    #         print(x[1])
    # keys2 = map2.keys()

    # mycursor__execute = mycursor2.execute("SELECT * FROM t_district_info")
    # map3 = {}
    # for x in mycursor2:
    #     map3[x[2]] = x[1]
    # keys3 = map3.keys()

    # for key in keys:
    #     for key2 in keys3:
    #         if key.find(key2) != -1:
    #             key_ = map[key]
    #             map_key_ = map3[key2]
    #             if map_key_ != key_[5]:
    #                 print(key_, map_key_)

    # for key in keys:
    #     if key not in keys2:
    #         v = map[key]
    #         city = v[4]
    #         # 城市中包含，军，大使馆，武警，部队，战区，民航，警，公安，外资，的跳过
    #         # if city.find('外资') != -1 or city.find('台湾') != -1 or city.find('军') != -1 or city.find('大使馆') != -1 or city.find('武警') != -1 or city.find('部队') != -1 or city.find('战区') != -1 or city.find('民航') != -1 or city.find('警') != -1 or city.find('公安') != -1:
    #         #     continue
    #         print(v)
